<template>
  <div>
    <div id="qrcode"></div>
  </div>
</template>

<script>
import QRCode from 'qrcodejs2'  // 引入qrcode
export default {
  props:{
    id:{
      type:null,
      required:true,
    },
    workflow_name:{
      type:null,
      required:true,
    }
  },
  data () {
    return {
      name:''
    }
  },
  mounted(){
    this.qrCode()
  },
  methods:{
    qrCode(){
      new QRCode('qrcode', {
        width: 80,  
        height:80,
        text: `http://howflow.leadot.com.cn/#/TicketDetails?ticket_id=${this.id}&workflow_name=${this.workflow_name}`, 
        colorDark : "#000",
        colorLight : "#fff",
      })
    }
  }
}
</script>

<style lang='less' scoped>
#qrcode{
  margin: 0 auto;
  width: 80px;
}
</style>
